import { ConfigType, registerAs } from '@nestjs/config'

import { env } from '~/global/env'

export const ossRegToken = 'oss'

export const OssConfig = registerAs(ossRegToken, () => ({
  accessKeyId: env('OSS_KEY_ID'),
  accessKeySecret: env('OSS_KEY_SECRET'),
  bucket: env('OSS_BUCKET'),
  region: env('OSS_REGION'),
  domain: env('OSS_DOMAIN'),
  arn: env('OSS_ARN'),
}))

export type IOssConfig = ConfigType<typeof OssConfig>
